home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
- *
- * displayDefs.h - Defs of various structs/data used by the display system.
- *
- *
- * HISTORY
- * 01 Sep 92 Joe Pasqua
- * Created.
- */
-
- //
- // Bits per pixel values.
- //
- typedef enum {
- IO_2BitsPerPixel, // 2 bpp grayscale
- IO_8BitsPerPixel, // 8 bpp grayscale
- IO_12BitsPerPixel, // 16 bpp, 12 used (4 bits/component)
- IO_15BitsPerPixel, // 16 bpp, 15 used (5 bits/component)
- IO_32BitsPerPixel, // 32 bpp, 24 used (8 bits/component)
- IO_VGA // VGA framebuffer
- // (VGA is special, and may not be
- // linearly mapped or packed pixel format.)
- } IOBitsPerPixel;
-
- // Definitions of Color Space Type and Values
- typedef unsigned short IOColorSpace;
- #define IO_DISPLAY_ONEISBLACKCOLORSPACE 0
- #define IO_DISPLAY_ONEISWHITECOLORSPACE 1
- #define IO_DISPLAY_RGBCOLORSPACE 2
- #define IO_DISPLAY_CMYKCOLORSPACE 3
-
- //
- // Structure describing the layout of the display.
- //
- typedef struct
- {
- int width; // Width in pixels
- int height; // Height in pixels
- int totalWidth; // Width in pixels including undisplayed pixels
- int rowBytes; // # bytes to get from one scanline to next
- int refreshRate; // Monitor refresh setting
-
- // Pointer to origin of screen. This pointer is deliberately
- // untyped to force actual screen writes to be dependent on
- // bits_per_pixel.
- void *frameBuffer;
-
- // VRAM configuration, indicated by memory space occupied by one pixel.
- IOBitsPerPixel bitsPerPixel;
- IOColorSpace colorSpace;
-
- // Flags used to indicate special requirements or conditions to DPS
- unsigned int flags;
-
- // Driver specific parameters
- void *parameters;
- } IODisplayInfo;
-
-
- //
- // Definition of values for the IODisplayInfo flags field
- //
-
- // Bit 1 determines whether the display requires gamma corrected 444->555
- // conversion in software.
- #define IO_DISPLAY_NEEDS_SOFTWARE_GAMMA_CORRECTION 0x00000002
-
- // Bits 2 and 3 specify cache behavior
- #define IO_DISPLAY_CACHE_WRITETHROUGH 0x00000000 // default
- #define IO_DISPLAY_CACHE_COPYBACK 0x00000004
- #define IO_DISPLAY_CACHE_OFF 0x00000008
- #define IO_DISPLAY_CACHE_MASK 0x0000000C
-
- // Bit 4 indicates if the a hardware gamma correction transfer table
- // (CLUT)exists and can be changed by an IODISPLAY_SET_TRANSFER_TABLE call.
- #define IO_DISPLAY_HAS_TRANSFER_TABLE 0x00000010
-
- // Parameter to be supported by Display subclasses in their implementation
- // of setIntValues:forParameter:count: method, if the driver supports
- // setting a hardware gamma correction transfer table.
- //
- // The transfer table has a maximum size of 256 ints, and may be smaller.
- // 32 or 24 bit color, and 8 bit monochrome displays use the full 256 entries.
- // 15 bit color displays use 32 entries. 12 bit color displays use 16 entries.
- // 2 bit monochrome displays use 4 entries. Each integer in the table holds
- // a packed RGBM value. Monochrome displays use the low byte. Color displays
- // should use the high 3 bytes, with Red in the most significant byte.
- #define IODISPLAY_SET_TRANSFER_TABLE "IO_Display_Set_Transfer_Table"
- #define IODISPLAY_SET_TRANSFER_TABLE_2BPP_SIZE 4
- #define IODISPLAY_SET_TRANSFER_TABLE_8BPP_SIZE 256
- #define IODISPLAY_SET_TRANSFER_TABLE_12BPP_SIZE 16
- #define IODISPLAY_SET_TRANSFER_TABLE_15BPP_SIZE 32
- #define IODISPLAY_SET_TRANSFER_TABLE_24BPP_SIZE 256
- #define IODISPLAY_SET_TRANSFER_TABLE_32BPP_SIZE 256
- #define IODISPLAY_SET_TRANSFER_TABLE_MAXSIZE 256
-
- #define IODISPLAY_GET_PORT "IO_Display_GetPort"
- #define IODISPLAY_GET_PORT_SIZE 1
-